﻿@model IEnumerable<Lavka.Models.Pages>

@{
    ViewBag.Title = "Страницы сайта";
}

<h2>Страницы сайта</h2>

<p>
    @Html.ActionLink("Создать", "Create")
</p>

<div class="roundedTable">    
    <table id="productsTable" class="productsTable">
        <tr>
        @if (Request.IsAuthenticated)
        {
            <th>
                Действия
            </th>
        }
@*        <th>
            ParentId
        </th>*@
        <th>
            Path
        </th>
        <th>
            Title
            
        </th>
        <th>
            Description
        </th>
        <th>
            Keywords
        </th>
    </tr>

@foreach (var item in Model) 
{
    <tr>
        <td>
            @Html.ActionLink("Редактировать", "Edit", new { path = item.Path }) |
            @Html.ActionLink("Удалить", "Delete", new { id=item.PageId })
        </td>
@*        <td>
            @Html.DisplayFor(modelItem => item.ParentId)
        </td>*@
        <td>
            @if (item.Path != null)
            {
                @Html.ActionLink(item.Path, "Details", new {id = item.PageId})
            }
        </td>
        <td>
            @if (item.Title != null)
            {
                @Html.DisplayFor(modelItem => item.Title)
            }
        </td>
        <td>
            @if (item.Description != null)
            {
                @Html.DisplayFor(modelItem => item.Description)
            }
        </td>
        <td>
            @if (item.Keywords != null)
            {
                @Html.DisplayFor(modelItem => item.Keywords)
            }
        </td>
    </tr>
}

</table>
</div>